package com.taobao.api.request;

import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.TaobaoObject;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.json.JSONWriter;
import com.taobao.api.response.WlbImportThreeplResourceGetResponse;

/**
 * TOP API: taobao.wlb.import.threepl.resource.get request
 * 
 * @author top auto create
 * @since 1.0, 2018.07.25
 */
public class WlbImportThreeplResourceGetRequest extends BaseTaobaoRequest<WlbImportThreeplResourceGetResponse> {
	
	

	/** 
	* 发货地区域id
	 */
	private Long fromId;

	/** 
	* 收件人地址
	 */
	private String toAddress;

	/** 
	* ONLINE或者OFFLINE
	 */
	private String type;

	public void setFromId(Long fromId) {
		this.fromId = fromId;
	}

	public Long getFromId() {
		return this.fromId;
	}

	public void setToAddress(String toAddress) {
		this.toAddress = toAddress;
	}

	public void setToAddress(AddressDto toAddress) {
		this.toAddress = new JSONWriter(false,true).write(toAddress);
	}

	public String getToAddress() {
		return this.toAddress;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return this.type;
	}

	public String getApiMethodName() {
		return "taobao.wlb.import.threepl.resource.get";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("from_id", this.fromId);
		txtParams.put("to_address", this.toAddress);
		txtParams.put("type", this.type);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<WlbImportThreeplResourceGetResponse> getResponseClass() {
		return WlbImportThreeplResourceGetResponse.class;
	}

	public void check() throws ApiRuleException {
		RequestCheckUtils.checkNotEmpty(fromId, "fromId");
		RequestCheckUtils.checkNotEmpty(type, "type");
	}
	
	/**
 * 收件人地址
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class AddressDto extends TaobaoObject {

	private static final long serialVersionUID = 7236433519366931826L;

	/**
		 * 市级地址
		 */
		@ApiField("city")
		private String city;
		/**
		 * 国家地址
		 */
		@ApiField("country")
		private String country;
		/**
		 * 区级地址
		 */
		@ApiField("county")
		private String county;
		/**
		 * 详细地址
		 */
		@ApiField("detail_address")
		private String detailAddress;
		/**
		 * 省级地址
		 */
		@ApiField("province")
		private String province;
		/**
		 * 街道地址
		 */
		@ApiField("town")
		private String town;
	

	public String getCity() {
			return this.city;
		}
		public void setCity(String city) {
			this.city = city;
		}
		public String getCountry() {
			return this.country;
		}
		public void setCountry(String country) {
			this.country = country;
		}
		public String getCounty() {
			return this.county;
		}
		public void setCounty(String county) {
			this.county = county;
		}
		public String getDetailAddress() {
			return this.detailAddress;
		}
		public void setDetailAddress(String detailAddress) {
			this.detailAddress = detailAddress;
		}
		public String getProvince() {
			return this.province;
		}
		public void setProvince(String province) {
			this.province = province;
		}
		public String getTown() {
			return this.town;
		}
		public void setTown(String town) {
			this.town = town;
		}

}


}